<template>
  <div class="container">
    <div class="titleBox">
      <span class="title">最近浏览</span>
      <span style="cursor: pointer;">查看更多...</span>
    </div>
    <div  class="imgBox">
        <div v-for="(i, index) in collectList" :key="index"  @click="toDetails(i.value)">
            <el-image style="width: 200px; height: 200px" :src="i.value" fit="cover" class="img" />
        </div>
      </div>
  </div>
  <!-- <div class="container">
    <div class="leftArrow" v-if="showLeft">
      <img src="./img/arrow_left.svg" @click="arrowClick('left')" />
    </div>
    <el-carousel height="300px" indicator-position="none" :autoplay=false :loop=false arrow="never" ref='cardShow'>
      <el-carousel-item v-for="(items, index) in collectList" :key="index">
        <div class="f_box">
          <div class="box" v-for="(i, index) in items" :key="index">
            <img :src="i.imgUrl" alt="" @click="toDetails(i.imgUrl)">
            <div class="name">{{i.title}}</div>
          </div>
        </div>
      </el-carousel-item>
    </el-carousel>
    <div class="rightArrow" v-if="showRight">
      <img src="./img/arrow_right.svg" @click="arrowClick('right')"/>
    </div>
  </div> -->
</template>

<script>
import { ref, toRefs } from 'vue'
import { useRouter } from 'vue-router'
export default {
  name: 'Collect-Lt',
  props: {
    urlList: {
      type: Array
    }
  },
  setup (props) {
    const collectList = ref([])
    const router = useRouter()
    function toDetails (imgurl) {
      router.push({ path: '/details', query: { url: imgurl } })
    }
    collectList.value = toRefs(props.urlList)
    return { collectList, toDetails }
  }
}
</script>

<style lang="less" scoped>
.container{
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  .titleBox{
    display: flex;
    align-items: baseline;
    height: 30px;
    width: 81vw;
    .title{
      flex: 1;
      align-self:space-between;
      color: rgba(0,0,0,.65);
      font-weight: 600;
      font-size: 20px;
      font-family: PingFangSC-Semibold,PingFang SC;
    }
  }
  .imgBox{
    display: flex;
    flex: auto;

    .img{
      margin: 30px 0 10px 20px;
      border-radius: 20px !important;
    }
  }
}

</style>
